public class TestSubstring {
    public static void main(String[] args) {
        String str = "hello world";
        String newStr = str.substring(0,5);
            System.out.println(newStr);
    }
}